//3.
public class Person {
    public String name;
    public int age;

    //构造函数：右键--Generate  自动生成
    public Person(){
        this.name="wangwu";
        System.out.println("不带参数的构造函数");
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("带两个参数的构造函数");
    }

    public Person(String name) {
        this.name = name;
        System.out.println("带一个参数的构造函数");
    }

    public void doClass(){
        System.out.println(this.name + "在上课");//在类中要习惯加上this
    }
}
